package com.czy.owner.api;

import com.czy.owner.db.UserHelper;
import com.czy.owner.global.Constants;
import com.czy.owner.net.api.BaseApi;
import com.czy.owner.net.listener.HttpOnNextListener;
import com.trello.rxlifecycle.components.support.RxAppCompatActivity;

import retrofit2.Retrofit;
import rx.Observable;

/**
 * Created by wangyang on 2017/5/6 0006.
 * 车主(未绑定)电商banner列表
 */

public class ShopBannerApi extends BaseApi{

    public ShopBannerApi(HttpOnNextListener listener, RxAppCompatActivity rxAppCompatActivity) {
        super(listener, rxAppCompatActivity);
        setShowProgress(true);
        setCache(true);
        setMothed(UserHelper.getInstance().getUserAccount()+Constants.OWN_OWNERSSHOPBANNER);//相当于缓存保存的Key
        setCookieNetWorkTime(30);//有网缓存30s,在30s内点击无效
        setCookieNoNetWorkTime(24*60*60*7);//无网缓存7天
    }

    @Override
    public Observable getObservable(Retrofit retrofit) {
        HttpPostService service = retrofit.create(HttpPostService.class);
        return service.getShopBannerApi();
    }


}
